<?php

/**
 * LicenseeMatch form base class.
 *
 * @method LicenseeMatch getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLicenseeMatchForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                       => new sfWidgetFormInputHidden(),
      'licensee_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Licensee01'), 'add_empty' => true)),
      'datetime_match'           => new sfWidgetFormDateTime(),
      'status'                   => new sfWidgetFormChoice(array('choices' => array('D' => 'D', 'V' => 'V'))),
      'opponent_lastname'        => new sfWidgetFormInputText(),
      'opponent_firstname'       => new sfWidgetFormInputText(),
      'opponent_point'           => new sfWidgetFormInputText(),
      'opponent_licensee_number' => new sfWidgetFormInputText(),
      'match_type_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('MatchType'), 'add_empty' => true)),
      'created_at'               => new sfWidgetFormDateTime(),
      'updated_at'               => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                       => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'licensee_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Licensee01'), 'required' => false)),
      'datetime_match'           => new sfValidatorDateTime(array('required' => false)),
      'status'                   => new sfValidatorChoice(array('choices' => array(0 => 'D', 1 => 'V'), 'required' => false)),
      'opponent_lastname'        => new sfValidatorString(array('max_length' => 65)),
      'opponent_firstname'       => new sfValidatorString(array('max_length' => 65)),
      'opponent_point'           => new sfValidatorNumber(array('required' => false)),
      'opponent_licensee_number' => new sfValidatorInteger(array('required' => false)),
      'match_type_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('MatchType'), 'required' => false)),
      'created_at'               => new sfValidatorDateTime(),
      'updated_at'               => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('licensee_match[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LicenseeMatch';
  }

}
